﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Copy_Bgm_Request.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.Copy_Bgm_Request" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server" style="font-size: small">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="pnDetail">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnDetail" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <script type="text/javascript">
            function GetRadWindow()
            {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
        
            function returnToParent()
            {
                var oArg = new Object();
                var oWnd = GetRadWindow();
            
                oWnd.close(oArg);
            }
        </script>
        <asp:Panel ID="pnDetail" runat="server">
            <div class="header-grid">
                คัดลอกข้อมูลโครงการจากปีเก่า <asp:Label ID="lblJobSiteName" runat="server" Visible="false" /><asp:Label ID="lblJobSiteSeq" runat="server" Visible="false" />
            </div>
            <div class="DivBody">
                <table>
                    <tr>
                        <td align="right" width="120px">
                            ปีปัจจุบัน :
                        </td>
                        <td width="120px">
                            <telerik:RadNumericTextBox ID="txtBgmYear" Runat="server" MaxValue="2600" 
                                MinValue="2500" ShowSpinButtons="True" Width="100px">
                                <NumberFormat ZeroPattern="n" DecimalDigits="0" GroupSeparator=""></NumberFormat>
                            </telerik:RadNumericTextBox>
                        </td>
                        <td align="right" width="100px">
                            ปีที่คัดลอก :
                        </td>
                        <td>
                            <telerik:RadNumericTextBox ID="txtBgmYearOld" Runat="server" MaxValue="2600" 
                                MinValue="2500" ShowSpinButtons="True" Width="100px"
                                AutoPostBack="true" ontextchanged="txtBgmYearOld_TextChanged">
                                <NumberFormat ZeroPattern="n" DecimalDigits="0" GroupSeparator=""></NumberFormat>
                            </telerik:RadNumericTextBox>
                        </td>
                    </tr>
                </table>
                <%--<table>
                    <tr>
                        <td align="right" width="120px">
                            แหล่งเงิน :
                        </td>
                        <td>
                            <telerik:RadComboBox ID="ddlBgmSourceSeq" runat="server"
                                DataTextField="text" DataValueField="value"
                                AutoPostBack="true" Filter="Contains" Width="400px" 
                                OnSelectedIndexChanged="ddlBgmSourceSeq_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                </table>--%>
            </div>
            <div align="center">
                <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridProject" runat="server"
                    AllowMultiRowSelection="true" AutoGenerateColumns="False" Width="99%" 
                    Height="320px" OnSelectedIndexChanged="gridProject_SelectedIndexChanged">
                    <%--OnItemDataBound="gridProject_ItemDataBound" --%>
                    <MasterTableView NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" width="100%"
                        GroupLoadMode="Client" GroupsDefaultExpanded="true" DataKeyNames="Sequence">                                                           
                        <Columns>
                            <telerik:GridBoundColumn DataField="Sequence" UniqueName="Sequence" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="bgm_prj_code" UniqueName="bgm_prj_code" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="35px" 
                                HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="bgm_prj_name"
                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="ชื่อโครงการ" ItemStyle-HorizontalAlign="Left" 
                                UniqueName="bgm_prj_name" >
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="total_amount"
                                DataFormatString="{0:#,##0.00}"
                                HeaderStyle-HorizontalAlign="Center"
                                HeaderText="วงเงิน(บาท)"
                                UniqueName="total_amount" Visible="true">
                                <HeaderStyle HorizontalAlign="Center" Width="120px"/>
                                <ItemStyle HorizontalAlign="Right" />
                            </telerik:GridBoundColumn>
                        </Columns>
                        <%--<GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="output_seq" HeaderText="&nbsp;" />
                                </GroupByFields>
                                <SelectFields>
                                    <telerik:GridGroupByField FieldName="output_name" HeaderText="ผลผลิต :" HeaderValueSeparator="" />
                                </SelectFields>
                            </telerik:GridGroupByExpression>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="act_seq" HeaderText="&nbsp;" />
                                </GroupByFields>
                                <SelectFields>
                                    <telerik:GridGroupByField FieldName="act_name" HeaderText="กิจกรรมหลัก :" HeaderValueSeparator="" />
                                </SelectFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>--%>
                    </MasterTableView>
                    <clientsettings EnablePostBackOnRowClick="true">
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                        <Selecting AllowRowSelect="True" />
                    </clientsettings>
                </telerik:RadGrid>
            </div>
            <div class="DivBody" align="center">
                <asp:Label ID="lblCount" runat="server" ForeColor="Red" />  <asp:Button ID="btnPopupSave" runat="server" Text="บันทึก" OnClick="btnPopupSave_Click" />
            </div>
        </asp:Panel>
    </form>
</body>
</html>
